﻿namespace GoodAdmin.System;

/// <summary>
/// 组织服务
/// </summary>
public interface ISysOrgService
{
    /// <summary>
    /// 获取所有组织列表
    /// </summary>
    /// <returns></returns>
    Task<List<OrgSimpleInfo>> GetOrgList();

    /// <summary>
    /// 获取组织树形列表
    /// </summary>
    /// <param name="DataScope"></param>
    /// <returns></returns>
    Task<List<OrgSimpleInfo>> GetOrgTree(List<long>DataScope=null);

    /// <summary>
    /// 组织选择器
    /// </summary>
    /// <returns></returns>
    Task<List<OrgSimpleInfo>> OrgSelector();
    /// <summary>
    /// 分页查询组织列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<SqlSugarPagedList<SysOrg>> GetOrgPageList(OrgPageInput input);
    /// <summary>
    /// 根据组织id获取组织明细
    /// </summary>
    /// <param name="OrgId"></param>
    /// <returns></returns>
    Task<OrgSimpleInfo> GetOrgDetail(long OrgId);

    /// <summary>
    /// 新增
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task AddOrg(OrgAddInput input);

    /// <summary>
    /// 批量增加组织
    /// </summary>
    /// <param name="importData"></param>
    /// <returns></returns>
    Task<List<OrgBatchAddOutput>> BatchAddOrg(List<OrgBatchAdd> importData);

    /// <summary>
    /// 更新
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task UpdateOrg(OrgUpdateInput input);

    /// <summary>
    /// 根据组织Id删除
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task DeleteOrg(BaseIdInput input);

    /// <summary>
    /// 获取当前组织的所有下级组织Id列表
    /// </summary>
    /// <param name="OrgId">当前组织Id</param>
    /// <param name="isContainSelf">是否包含自己</param>
    /// <returns></returns>
    Task<List<long>> GetOrgChildrenIdList(long OrgId, bool isContainSelf = true);

    /// <summary>
    /// 获取当前组织的所有下级组织Id列表
    /// </summary>
    /// <param name="OrgIdList">当前组织Id</param>
    /// <param name="isContainSelf">是否包含自己</param>
    /// <returns></returns>
    Task<List<long>> GetOrgChildrenIdList(List<long> OrgIdList, bool isContainSelf = true);

    /// <summary>
    /// 部门是否存在
    /// </summary>
    /// <param name="orgId"></param>
    /// <returns></returns>
    Task<bool> IsOrgExist(long orgId);
}
